<template>
	<el-dialog v-model="visible" :title="title" :width="500" destroy-on-close @closed="$emit('closed')">
		<!-- <el-form ref="dialogForm" :model="form" :rules="rules" :disabled="mode == 'show'" label-width="100px">
			<el-form-item label="最终权限" prop="powerData">
				<el-input v-model="form.powerData" style="width: 100%" :autosize="{ minRows: 2 }" type="textarea"
					placeholder="Please input" />
			</el-form-item>
		</el-form> -->
		<el-input v-model="powerData" style="width: 100%" :autosize="{ minRows: 2 }" type="textarea"
			placeholder="Please input" :disabled="true" />
		<template #footer>
			<el-button @click="visible = false">关 闭</el-button>
			<!-- <el-button v-if="mode != 'show'" type="primary" :loading="isSaveing" @click="submit()">保 存</el-button> -->
		</template>
	</el-dialog>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	data() {
		return {
			mode: 'add',
			visible: false,
			isSaveing: false,
			//表单数据
			// form: {
			// 	powerData: ''
			// },
			powerData: '',
			//验证规则
			rules: {
				sort: [{ required: true, message: '请输入排序', trigger: 'change' }],
				label: [{ required: true, message: '请输入部门名称' }]
			},
			//所需数据选项
			groups: [],
			groupsProps: {
				value: 'id',
				emitPath: false,
				checkStrictly: true,
				expandTrigger: 'hover'
			},
			title: ''
		}
	},
	mounted() {
	},
	methods: {
		handleChange(value) {
			console.log(value)
			this.$refs.orgRef.dropDownVisible = false //监听值发生变化就关闭它
		},

		//显示
		open(mode = 'show') {
			this.mode = mode
			this.visible = true
			return this
		},
		//表单注入数据
		setData(data, flag) {
			if (flag) {
				//查功能权限
				this.title = '查看功能权限'
				this.powerData = data.actionPower == '' ? '空' : data.actionPower

			} else {
				//查数据权限
				this.title = '查看数据权限'
				this.powerData = data.dataPower == '' ? '空' : data.dataPower

			}
		}
	}
}
</script>

<style></style>
